
#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>
#include <Rectangle.h>

USING_MOCKCPP_NS
USING_TESTNGPP_NS

FIXTURE(Rectangle)
{
	TEST(should be able to get area)
	{
		Rectangle rectangle(3,4);
		ASSERT_EQ(12, rectangle.getArea());
	}

	TEST(should be able to get perimeter)
	{
		Rectangle rectangle(2,7);
		ASSERT_EQ(18, rectangle.getPerimeter());
	}

	TEST(should be able to get area as 42 after change width as 7 while length kept as 6)
	{
		Rectangle rectangle(6,5);
                
                rectangle.setWidth(7);
		ASSERT_EQ(42, rectangle.getArea());
	}
	TEST(should be able to get perimeter as 26 after change width as 7 while length kept as 6)
	{
		Rectangle rectangle(6,5);
                
                rectangle.setWidth(7);
		ASSERT_EQ(26, rectangle.getPerimeter());
	}
	TEST(should be able to get area as 35 after change length as 7 while width kept as 5)
	{
		Rectangle rectangle(6,5);
                
                rectangle.setLength(7);
		ASSERT_EQ(35, rectangle.getArea());
	}
	TEST(should be able to get perimeter as 24 after change length as 7 while width kept as 5)
	{
		Rectangle rectangle(6,5);
                
                rectangle.setLength(7);
		ASSERT_EQ(24, rectangle.getPerimeter());
	}
};

